import Vue from 'vue'
import Router from 'vue-router'
import LoginVue from '@/components/Login.vue'

Vue.use(Router)


const router = new Router({
    routes:[
        // login页面重定向到/
        {
            path:'/',
            redirect:'/login',
            meta:{
                title: 'Besrey-登录页'
            }
        },
        {
            path:'/login',
            component: LoginVue,
            meta:{
                title: 'Besrey-登录页'
            }
        }
    ]
})

router.beforeEach((to, from, next) => {
  if (to.meta && to.meta.title) {
    document.title = to.meta.title
  }
  next()
})


export default router;





